home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / ToolUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  3.4 KB  |  172 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ToolUtils.h
  3.  
  4.      Contains:    Toolbox Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1990-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __TOOLUTILS__
  19. #define __TOOLUTILS__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __OSUTILS__
  25. #include <OSUtils.h>
  26. #endif
  27.  
  28. #if OLDROUTINELOCATIONS
  29. #ifndef __FIXMATH__
  30. #include <FixMath.h>
  31. #endif
  32. #ifndef __ICONS__
  33. #include <Icons.h>
  34. #endif
  35. #ifndef __QUICKDRAW__
  36. #include <Quickdraw.h>
  37. #endif
  38. #ifndef __TEXTUTILS__
  39. #include <TextUtils.h>
  40. #endif
  41. #endif  /* OLDROUTINELOCATIONS */
  42.  
  43.  
  44.  
  45. #if PRAGMA_ONCE
  46. #pragma once
  47. #endif
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53. #if PRAGMA_IMPORT
  54. #pragma import on
  55. #endif
  56.  
  57. #if PRAGMA_STRUCT_ALIGN
  58.     #pragma options align=mac68k
  59. #elif PRAGMA_STRUCT_PACKPUSH
  60.     #pragma pack(push, 2)
  61. #elif PRAGMA_STRUCT_PACK
  62.     #pragma pack(2)
  63. #endif
  64.  
  65. /*
  66. ————————————————————————————————————————————————————————————————————————————————————
  67.     Note: 
  68.     
  69.     The following routines that used to be in this header file, have moved to
  70.     more appropriate headers.  If OLDROUTINELOCATIONS is 0, then you will have
  71.     to include the headers below to use the following functions.
  72.     
  73.         FixMath.h:        FixMul
  74.                         FixRatio
  75.                         FixRound
  76.         
  77.         Icons.h:          GetIcon
  78.                         PlotIcon
  79.                         
  80.         Quickdraw.h:    AngleFromSlope
  81.                         DeltaPoint
  82.                         GetCursor
  83.                         GetIndPattern
  84.                         GetPattern
  85.                         GetPicture
  86.                         PackBits
  87.                         ScreenRes
  88.                         ShieldCursor
  89.                         SlopeFromAngle
  90.                         UnpackBits
  91.                         
  92.         TextUtils.h:    Munger
  93.                         GetIndString
  94.                         GetString
  95.                         NewString
  96.                         SetString
  97. ————————————————————————————————————————————————————————————————————————————————————
  98. */
  99.  
  100.  
  101. EXTERN_API( Boolean )
  102. BitTst                            (const void *            bytePtr,
  103.                                  long                     bitNum)                                ONEWORDINLINE(0xA85D);
  104.  
  105. EXTERN_API( void )
  106. BitSet                            (void *                    bytePtr,
  107.                                  long                     bitNum)                                ONEWORDINLINE(0xA85E);
  108.  
  109. EXTERN_API( void )
  110. BitClr                            (void *                    bytePtr,
  111.                                  long                     bitNum)                                ONEWORDINLINE(0xA85F);
  112.  
  113. EXTERN_API( long )
  114. BitAnd                            (long                     value1,
  115.                                  long                     value2)                                ONEWORDINLINE(0xA858);
  116.  
  117. EXTERN_API( long )
  118. BitOr                            (long                     value1,
  119.                                  long                     value2)                                ONEWORDINLINE(0xA85B);
  120.  
  121. EXTERN_API( long )
  122. BitXor                            (long                     value1,
  123.                                  long                     value2)                                ONEWORDINLINE(0xA859);
  124.  
  125. EXTERN_API( long )
  126. BitNot                            (long                     value)                                ONEWORDINLINE(0xA85A);
  127.  
  128. EXTERN_API( long )
  129. BitShift                        (long                     value,
  130.                                  short                     count)                                ONEWORDINLINE(0xA85C);
  131.  
  132. #if TARGET_CPU_68K
  133. struct Int64Bit {
  134.     SInt32                             hiLong;
  135.     UInt32                             loLong;
  136. };
  137. typedef struct Int64Bit Int64Bit;
  138.  
  139. EXTERN_API( void )
  140. LongMul                            (long                     a,
  141.                                  long                     b,
  142.                                  Int64Bit *                result)                                ONEWORDINLINE(0xA867);
  143.  
  144. #else
  145.     #define LongMul(a, b, result) ((void) WideMultiply((a), (b), (wide*)(result)))
  146. #endif  /* TARGET_CPU_68K */
  147.  
  148. #define HiWord(x) ((short)((long)(x) >> 16))
  149. #define LoWord(x) ((short)(x))
  150.  
  151.  
  152. #if PRAGMA_STRUCT_ALIGN
  153.     #pragma options align=reset
  154. #elif PRAGMA_STRUCT_PACKPUSH
  155.     #pragma pack(pop)
  156. #elif PRAGMA_STRUCT_PACK
  157.     #pragma pack()
  158. #endif
  159.  
  160. #ifdef PRAGMA_IMPORT_OFF
  161. #pragma import off
  162. #elif PRAGMA_IMPORT
  163. #pragma import reset
  164. #endif
  165.  
  166. #ifdef __cplusplus
  167. }
  168. #endif
  169.  
  170. #endif /* __TOOLUTILS__ */
  171.  
  172.